Skip to main content

Logical Conditions

Many a times, there is a need to display data based on conditions. For example - if the variable "account status" is not active, then you would want to send an email stating "Your account is blocked!". Such are the applications of a conditional statement.

In this chapter we will discuss the Basic if, else, else if conditional statement. A step-wise discussion can be found on the next page of this chapter.

There can be other types of Conditional Statements and applications like :

  • Unless
  • greaterThan
  • lessThan
  • Equals
  • notEquals
  • And
  • Or
  • Length etc.

To learn more about these, visit - https://docs.sendgrid.com/for-developers/sending-email/using-handlebars#conditional-statements

A video tutorial has been prepared here:

At the time of writing this guide, the conditional statements do not work properly with RAPID integration.